import { TablePropType } from '@/interfaces/Element/Table.js'
export interface TableDataObjType {
  id: number
  date: string
  name: string
  address: string
  tag: string
  children?: Array<TableDataObjType>
}

export const tableType = ref<Array<TablePropType>>([
  {
    prop: 'id',
    label: 'ID',
    minWidth: '10%'
  },
  {
    prop: 'name',
    label: '姓名',
    minWidth: '10%'
  },
  {
    prop: 'address',
    isSlot: true,
    label: '住址',
    minWidth: '35%'
  },
  {
    prop: 'date',
    label: '禁止拖拽',
    notSortable: true,
    minWidth: '15%'
  },
  {
    prop: 'tag',
    label: 'Tag',
    isSlot: true,
    minWidth: '15%'
  },
  {
    prop: 'action',
    label: '操作',
    isSlot: true,
    header_slot: true,
    notSortable: true,
    minWidth: '25%'
  }
])
export const tableData = ref<Array<TableDataObjType>>([
  {
    id: 0,
    date: '2016-05-03',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
    tag: 'Home'
  },
  {
    id: 1,
    date: '2016-05-02',
    name: 'Andy',
    address: 'No. 189, Grove St, Los Angeles',
    tag: 'Office'
  },
  {
    id: 2,
    date: '2016-05-04',
    name: 'Ani',
    address: 'No. 189, Grove St, Los Angeles',
    tag: 'Office'
  },
  {
    id: 3,
    date: '2016-05-04',
    name: 'Ani',
    address: 'No. 189, Grove St, Los Angeles',
    tag: 'Office'
  }
])

export const getTableDataDefault = () => {
  for (let i = 0; i < 30; i++) {
    tableData.value.push({
      id: 4 + i,
      date: '2016-05-04',
      name: 'Ani',
      address: 'No. 189, Grove St, Los Angeles',
      tag: 'Office'
    })
  }
}
getTableDataDefault()
